package com.sd.nacosdemo.config;

import com.sd.nacosdemo.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时器
 */
@Component
public class TimerTask {

    @Autowired
    private EmployeeService employeeService;


    /**
     * 每天凌晨0：0：1开启任务
     */
    @Scheduled(cron = "0 */2 * * * ?")
    public void selectIsStatus(){

        System.out.println("----------------------------定时器-------------------------------");

        try {
            //employeeService.isThreeDay();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
